#ifndef __YMODEM_H
#define __YMODEM_H

#include "sys.h"

typedef struct
{
    void *disk;
	uint32_t addr;
	char name[16];
	uint32_t length;
    uint32_t seek;
}YMODEM_FILE;

typedef  uint8_t (*ymodem_cb)(YMODEM_FILE* file, uint8_t *data, uint16_t datalen);

extern int ymodem_receive(void *dev, YMODEM_FILE* yfile, ymodem_cb callback);
extern int ymodem_transmit(void *dev, YMODEM_FILE* yfile, ymodem_cb callback);

#endif
